<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>PWA Demo</title>
    <link rel="manifest" href="./manifest.json" />
    <meta name="theme-color" content="#317EFB" />
  </head>
  <body>
    <iframe
      src="https://www.kdocs.cn"
      style="border: 0; width: 100%; height: 100vh"
    ></iframe>

    <script>
      if ("serviceWorker" in navigator) {
        console.log("abcdefg");
        navigator.serviceWorker
          .register("./sw.js")
          .then(() => console.log("Service Worker 注册成功"))
          .catch((err) => console.log("SW 注册失败", err));
      } else {
        console.log("abcdefg");
      }
    </script>
  </body>
</html>
